<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="Copyright © 2016-2017 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>入门指南</title>

    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../index.html" />
    <link rel="up" title="CDAP 数据流管道" href="index.html" />
    <link rel="next" title="CDAP 数据流设计器" href="studio.html" />
    <link rel="prev" title="CDAP 数据流管道简介" href="concepts-design.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: user-guide -->
<!-- theme_manual_highlight: guides -->
<!-- sidebar_title_link: ../table-of-contents/../../guides.html -->

  <div role="note" aria-label="manuals links"><h3><a href="../table-of-contents/../../guides.html">Guides</a></h3>

    <ul class="this-page-menu">
      <li class="toctree-l1"><b><a href="../table-of-contents/../../user-guide/index.html" rel="nofollow">用户手册</a></b>
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html"> 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../overview.html"> 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/index.html"> 入门指南</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/campaign.html">MySQL 客户数据</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/nytimes-xml.html">纽约时报 XML 数据推送</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/stocks.html">股票选择</a></li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials/fitbit.html">物联网 IoT 设备数据</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../data-preparation/index.html"> 数据预处理</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/concepts.html">      概念</a></li>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/directives/index.html">      数据处理指令</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/catalog-lookup.html">catalog-lookup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/change-column-case.html">change-column-case</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/changing-case.html">changing-case</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/cleanse-column-names.html">cleanse-column-names</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/columns-replace.html">columns-replace</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/copy.html">copy</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/cut-character.html">cut-character</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/decode.html">decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/diff-date.html">diff-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/drop.html">drop</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/encode.html">encode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/extract-regex-groups.html">extract-regex-groups</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/fail.html">fail</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/fill-null-or-empty.html">fill-null-or-empty</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/filter-row-if-matched.html">filter-row-if-matched</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/filter-row-if-true.html">filter-row-if-true</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/filter-rows-on.html">filter-rows-on</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/find-and-replace.html">find-and-replace</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/flatten.html">flatten</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/format-date.html">format-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/format-unix-timestamp.html">format-unix-timestamp</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/generate-uuid.html">generate-uuid</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/hash.html">hash</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/increment-variable.html">increment-variable</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/index-split.html">index-split</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/invoke-http.html">invoke-http</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/json-path.html">json-path</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/keep.html">keep</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/mask-number.html">mask-number</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/mask-shuffle.html">mask-shuffle</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/merge.html">merge</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-avro-file.html">parse-as-avro-file</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-avro.html">parse-as-avro</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-csv.html">parse-as-csv</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-date.html">parse-as-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-excel.html">parse-as-excel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-fixed-length.html">parse-as-fixed-length</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-hl7.html">parse-as-hl7</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-json.html">parse-as-json</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-log.html">parse-as-log</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-simple-date.html">parse-as-simple-date</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-as-xml.html">parse-as-xml</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-timestamp.html">parse-timestamp</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/parse-xml-to-json.html">parse-xml-to-json</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/quantize.html">quantize</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/rename.html">rename</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/send-to-error.html">send-to-error</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-charset.html">set-charset</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-column.html">set-column</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-columns.html">set-columns</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-record-delim.html">set-record-delim</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-type.html">set-type</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/set-variable.html">set-variable</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/split-by-separator.html">split-by-separator</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/split-email.html">split-email</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/split-to-columns.html">split-to-columns</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/split-to-rows.html">split-to-rows</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/split-url.html">split-url</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/stemming.html">stemming</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/swap.html">swap</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/table-lookup.html">table-lookup</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/text-distance.html">text-distance</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/text-metric.html">text-metric</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/trim.html">trim</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/url-decode.html">url-decode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/url-encode.html">url-encode</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/write-as-csv.html">write-as-csv</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/write-as-json-map.html">write-as-json-map</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/write-as-json-object.html">write-as-json-object</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/directives/xpath.html">xpath</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/functions/index.html">      函数</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/json-functions.html">JSON 函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/type-functions.html">类型函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/geofence-functions.html">地理围栏函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/dq-functions.html">数据质量函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/date-functions.html">日期函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/functions/ddl-functions.html">DDL 函数</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/service/index.html">      服务</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/admin.html">行政和管理服务</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/connection-properties.html">连接属性</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/connections.html">连接服务</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/execution.html">数据处理指令执行</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/request.html">请求格式规范</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/schema-registry.html">Schema 注册库</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-preparation/service/services.html">数据预处理服务</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/performance.html">性能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../data-preparation/exclusion-and-aliasing.html">排除与别名</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html"> 数据流管道</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="concepts-design.html"> 概念与设计</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"> 入门指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="studio.html"> CDAP 数据流设计器</a></li>
<li class="toctree-l2"><a class="reference internal" href="creating-pipelines.html"> 创建数据流管道</a></li>
<li class="toctree-l2"><a class="reference internal" href="running-pipelines.html"> 运行数据流管道</a></li>
<li class="toctree-l2"><a class="reference internal" href="plugin-management.html"> 插件管理</a></li>
<li class="toctree-l2"><a class="reference internal" href="plugins/index.html"> 插件参考</a><ul>
<li class="toctree-l3"><a class="reference internal" href="plugins/actions/index.html"> Action Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/sources/index.html"> Source Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/transforms/index.html"> Transform Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/analytics/index.html"> Analytic Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/sinks/index.html"> Sink Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/shared-plugins/index.html"> Shared Plugins</a><ul>
<li class="toctree-l4"><a class="reference internal" href="plugins/shared-plugins/core.html">CoreValidator</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="plugins/post-run-plugins/index.html"> Post-run Plugins</a><ul class="simple">
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../mmds/index.html"> 数据分析</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../mmds/concepts.html"> Concepts</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mmds/feature-gen.html"> Feature Generation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mmds/modeling.html"> Modeling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mmds/example.html"> Example</a></li>
</ul>
</li>
</ul>
</nav>
      </li>
      <li class="toctree-l1"><a href="../table-of-contents/../../developer-manual/index.html" rel="nofollow">开发手册</a>
      </li>
      <li class="toctree-l1"><a href="../table-of-contents/../../admin-manual/index.html" rel="nofollow">管理手册</a>
      </li>
      <li class="toctree-l1"><a href="../table-of-contents/../../integrations/index.html" rel="nofollow">集成手册</a>
      </li>
      <li class="toctree-l1"><a href="../table-of-contents/../../examples-manual/index.html" rel="nofollow">最佳实践</a>
      </li>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="user-guide-cdap-pipelines-getting-started">
<span id="id1"></span><h1>入门指南<a class="headerlink" href="#user-guide-cdap-pipelines-getting-started" title="Permalink to this headline">🔗</a></h1>
<p>这是一个快速教程, 涵盖了 CDAP 数据流管道的基础知识. 假定您熟悉 CDAP,
以及 CDAP 中的流数据 (stream), 数据集 (dataset), 和应用 (application),
CDAP UI 上的基本操作, 例如将事件输入流中并浏览数据集:</p>
<blockquote>
<div><ol class="arabic simple">
<li><a class="reference internal" href="#cdap">安装 CDAP</a></li>
<li><a class="reference internal" href="#id2">启动 CDAP 数据流管道</a></li>
<li><a class="reference internal" href="#id3">启动 CDAP 管道设计器</a></li>
<li><a href="#id21"><span class="problematic" id="id22">`CDAP 管道设计器快速向导`_</span></a></li>
<li><a class="reference internal" href="#id5">创建一个简单的数据流管道</a></li>
</ol>
</div></blockquote>
<div class="section" id="cdap">
<span id="cdap-pipelines-getting-started-install"></span><h2>安装 CDAP<a class="headerlink" href="#cdap" title="Permalink to this headline">🔗</a></h2>
<ul class="simple">
<li>如果你还没有准备好, 请参考 <span class="xref std std-ref">下载并安装 CDAP Sandbox</span>.</li>
<li><span class="xref std std-ref">启动 CDAP</span>, 打开一个 WEB 浏览器, 然后浏览到 <a class="reference external" href="http://localhost:11011/oldcdap/ns/default/">CDAP UI</a>.</li>
</ul>
</div>
<div class="section" id="cdap-pipelines-getting-started-start">
<span id="id2"></span><h2>启动 CDAP 数据流管道<a class="headerlink" href="#cdap-pipelines-getting-started-start" title="Permalink to this headline">🔗</a></h2>
<ul class="simple">
<li>要开始创建 CDAP 数据流管道, 请从左上角的下拉菜单中选择 <em>数据流管道</em>,</li>
</ul>
<p>或者转到 <a class="reference external" href="http://localhost:11011/oldcdap/ns/default/pipelines/">CDAP 数据流管道 URL</a>.</p>
<blockquote>
<div><p>这将引导你到数据流管道列表, 该列表很可能什么也没有:</p>
<div class="figure align-center" id="id6" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-no-pipelines.png"><img alt="../_images/cdap-pipelines-no-pipelines.png" class="bordered-image" src="../_images/cdap-pipelines-no-pipelines.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 数据流管道列表</span></p>
</div>
</div></blockquote>
</div>
<div class="section" id="cdap-pipelines-getting-started-cdap-studio">
<span id="id3"></span><h2>启动 CDAP 管道设计器<a class="headerlink" href="#cdap-pipelines-getting-started-cdap-studio" title="Permalink to this headline">🔗</a></h2>
<ul>
<li><p class="first">要启动 <em>CDAP 管道设计器</em> 并开始创建数据流管道, 请执行以下任一操作:</p>
<ul class="simple">
<li>单击 <em>+</em> 按钮添加新数据流管道;</li>
<li>单击工具栏标签 <em>管道设计器</em> (在 <em>数据流管道</em> 左侧); 或</li>
<li>转到 <a class="reference external" href="http://localhost:11011/oldcdap/ns/default/pipelines/studio?artifactType=cdap-data-pipeline">CDAP 管道设计器 URL</a></li>
</ul>
<p>管道设计器将会启动您现在可以创建一个新管道,
默认情况下是菜单中的第一个管道类型是 <em>数据流管道 - 批处理</em>, 是一个批处理类型数据流管道:</p>
<div class="figure align-center" id="id7" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-studio-empty.png"><img alt="../_images/cdap-studio-empty.png" class="bordered-image" src="../_images/cdap-studio-empty.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 用于创建管道的空画布</span></p>
</div>
</li>
</ul>
</div>
<div class="section" id="cdap-pipelines-getting-started-studio-tour">
<span id="id4"></span><h2>CDAP 管道设计器快速浏览<a class="headerlink" href="#cdap-pipelines-getting-started-studio-tour" title="Permalink to this headline">🔗</a></h2>
<p>在开始示例之前, 让我们看一下设计器及其不同的组件:</p>
<div class="figure align-center" id="id8" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-studio-annotated.png"><img alt="../_images/cdap-studio-annotated.png" class="bordered-image" src="../_images/cdap-studio-annotated.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 显示组件的注释</span></p>
</div>
<p>左上角是一个菜单, 用于指定您当前用于数据流管道的 <strong>应用模板构件</strong>.
现在, 我们将使用默认, <em>数据流管道 - 批处理</em>.</p>
<p>左侧边栏中是代表与当前应用程序模板一起使用的不同 <strong>可用插件</strong> 的图标.
它们被分为不同的类别. 通过单击每个类别标签
(<em>数据源, 数据转换, 数据分析, 数据接收器, 条件和动作</em>) 左侧的三角形图标来显示.</p>
<p>中间灰色的网格是 <strong>设计器画布</strong>, 可通过单击左侧边栏中的可用插件将插件的图标添加到画布,
然后将图标拖动到适当的位置来创建数据流管道.</p>
<p>该图显示了一个 <strong>数据流管道</strong>, 其中有三个 <strong>插件图标</strong>, 并且前两个图标已连接.</p>
<p>请注意, 图标具有不同的 <strong>颜色</strong> 和 <strong>形状</strong>, 并具有不同形状的 <strong>连接节点</strong>
(用于数据连接的 <strong>圆形</strong> 或用于控制连接的 <strong>方形</strong>):</p>
<ul class="simple">
<li><strong>绿色:</strong> 代表一个数据 <strong>生成器</strong>, 只具有一个 <strong>右侧</strong> 数据连接节点, 例如 <em>数据源</em> 插件</li>
<li><strong>蓝色:</strong> 代表一个数据 <strong>接收器和生成器</strong>, 同时具有 <strong>左侧和右侧</strong> 数据连接节点,
例如 <em>数据转换</em> 和 <em>数据分析</em> 插件</li>
<li><strong>紫色:</strong> 代表一个数据 <strong>接收器</strong>, 只具有一个 <strong>左侧</strong> 数据连接节点, 例如 <em>数据接收器</em> 插件</li>
<li><strong>棕色:</strong> 一个八角形的 <strong>控件</strong>, 同时具有 <strong>左侧和右侧</strong> 控件连接节点, 例如 <em>条件和动作</em> 插件</li>
</ul>
<p>带数字的黄色小圆圈表示插件 <strong>缺少配置值</strong>.</p>
<p>图标之间是灰色 <strong>连接线</strong>, 其中箭头指示数据流向. 实线表示数据流; 虚线连接线表示控制流程.</p>
<p>现在, 让我们创建一个数据流管道!</p>
</div>
<div class="section" id="cdap-pipelines-getting-started-simple">
<span id="id5"></span><h2>创建一个简单的数据流管道<a class="headerlink" href="#cdap-pipelines-getting-started-simple" title="Permalink to this headline">🔗</a></h2>
<p>在此示例中, 我们将创建一个数据流管道, 该管道从数据源中读取日志文件事件,
将其解析为单独的字段, 并将其作为单独的记录写入表中.</p>
<ol class="arabic">
<li><p class="first">首先单击左侧面板中的 <em>数据流</em> 数据源, 以将 <em>数据流</em> 图标添加到画布中.</p>
</li>
<li><p class="first">单击 <em>数据转换</em> 标签左侧的三角形以显示 <em>数据转换</em> 类型的插件,
然后单击 <em>日志解析器</em> 向画布添加另一个图标.</p>
</li>
<li><p class="first">单击 <em>数据接收器</em> 标签左侧的三角形以显示 <em>数据接收器</em> 类型的插件,
然后单击 <em>数据表</em> 向画布添加另一个图标.</p>
<p>您的画布应如下所示:</p>
<div class="figure align-center" id="id9" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-1-icons.png"><img alt="../_images/cdap-pipelines-gs-1-1-icons.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-1-icons.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 显示图标</span></p>
</div>
</li>
<li><p class="first">通过点击 <em>数据流</em> 右侧的绿色连接, 然后拖到 <em>日志解析器</em> 左侧连接上放开鼠标,
将 <em>数据流</em> 连接到 <em>日志解析器</em> 连接起来. 您的画布现在应如下所示:</p>
<div class="figure align-center" id="id10" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-2-connected.png"><img alt="../_images/cdap-pipelines-gs-1-2-connected.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-2-connected.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 显示连接</span></p>
</div>
</li>
<li><p class="first">同样, 将 <em>日志分析器</em> 连接到 <em>数据表</em> 完成连接. 现在, 您的画布应如下所示,
插件上的黄色标记显示每个插件都有许多属性需要设置:</p>
<div class="figure align-center" id="id11" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-3-connected.png"><img alt="../_images/cdap-pipelines-gs-1-3-connected.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-3-connected.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 显示连接</span></p>
</div>
<p>(如果您输入有误或需要删除连接, 请在要断开连接的箭头右侧的白色圆圈上单击并拖动.
当您拖动该圆圈并释放鼠标时, 该连接将变为删除并消失.)</p>
</li>
<li><p class="first">要设置插件的属性, 请依次单击每个图标. 单击图标时, 将出现一个对话框,
显示每个插件可用的属性. 所有**必需**属性均在标签后以红色星号表示.
这个例子中, <em>数据流</em> 图标已经点开, 其中 <em>标签</em>, <em>数据流名称</em>,
和 <em>持续时间</em> 显示为必需属性:</p>
<div class="figure align-center" id="id12" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-4-stream.png"><img alt="../_images/cdap-pipelines-gs-1-4-stream.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-4-stream.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 显示数据流插件属性的编辑</span></p>
</div>
<p>输入数据流名称, 例如 <em>demoStream</em>, 和持续时间, 例如 <em>1d</em>.
由于更改是自动保存的, 因此您可以通过单击关闭按钮 (右上角的 <em>X</em>),
键盘上的 <em>escape</em> 键或在对话框外部单击, 来关闭对话框.</p>
</li>
<li><p class="first">以类似的方式, 编辑 <em>日志解析器</em> 的属性, 设置 <em>输入名称</em> 为 <em>body</em>,
接受默认的 <em>日志格式</em>: <em>CLF</em>.</p>
<p>编辑 <em>数据表</em> 的属性, 然后将 <em>名称</em> 设置为 <em>demoTable</em>, <em>行字段</em> 为 <em>ts</em> (表示时间戳).</p>
<p>您可能会注意到, 当您从数据流移动到数据表时, 显示的 schema 已更改;
<em>日志解析器</em> 修改了 schema, 将 <em>body</em> 解析为了数据表需要的几个字段.</p>
</li>
<li><p class="first">完成后, 所有图标应显示所有必填字段已完成, 因此图标上没有黄色圆圈.</p>
<p>通过单击文本来命名数据流管道 (还有什么方法!)
在画布区域上方命名 <em>命名你的数据流管道</em>, 然后输入诸如 <em>demoPipeline</em> 这样的名称.
管道名称中不允许使用空格.</p>
<p>要检查所有内容是否完整, 请单击画布区域上方的按钮中的 <em>验证</em> 按钮, 这些控件位于右上角:</p>
<div class="figure align-center" id="id13" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-5-buttons.png"><img alt="../_images/cdap-pipelines-gs-1-5-buttons.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-5-buttons.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 管道设计器:</strong> 按钮标签，右上工具栏</span></p>
</div>
<p>单击 <em>验证</em> 钮应产生类似于以下内容的消息:</p>
<div class="highlight-java notranslate"><div class="highlight"><pre><span></span><span class="n">Validation</span> <span class="n">success</span><span class="o">!</span> <span class="n">Pipeline</span> <span class="n">demoPipeline</span> <span class="n">is</span> <span class="n">valid</span><span class="p">.</span>
</pre></div>
</div>
</li>
<li><p class="first">如果有任何错误, 请更正它们, 然后再继续.</p>
<p>否则, 单击 <em>发布</em> 按钮: 将保存数据流管道配置; 否则, 请单击 <em>确定</em>.
根据您设置的配置, 将创建一个 CDAP 应用程序, 并带有数据流和数据集表;
然后该应用程序即可运行.</p>
<p>请注意, 在发布阶段可能会发生验证期间未捕获的错误; 解决这些问题 (如果有),
然后再继续.</p>
<p>视图将更改以显示完成的应用程序:</p>
<div class="figure align-center" id="id14" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-6-pipeline.png"><img alt="../_images/cdap-pipelines-gs-1-6-pipeline.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-6-pipeline.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 演示数据流管道</span></p>
</div>
<p>尽管此管道视图不可编辑, 但单击图标将弹出与以前相同的对话框,
显示已为管道的每个阶段配置了哪些值.</p>
</li>
<li><p class="first">管道视图具有用于启动和管理物理应用程序的控件;
要注意的重要按钮是 <em>运行</em> (左侧) 和 <em>在 CDAP 中查看</em> (右侧):</p>
<div class="figure align-center" id="id15" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-8-pipeline-annotated.png"><img alt="../_images/cdap-pipelines-gs-1-8-pipeline-annotated.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-8-pipeline-annotated.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 控制按钮，管道视图</span></p>
</div>
</li>
<li><p class="first">在运行管道之前, 我们需要将数据放入数据流中, 以便应用程序可以执行操作.
通过点击 <em>在 CDAP 查看</em> 按钮, 导航到该数据流, 然后点击 <em>数据集</em> 按钮,
再点击 <em>demoStream</em> 按钮:</p>
<blockquote>
<div><div class="figure align-center" id="id16" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-7-stream.png"><img alt="../_images/cdap-pipelines-gs-1-7-stream.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-7-stream.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP demoStream:</strong> 状态页面, 带有用于发送事件的 <em>操作</em> 菜单</span></p>
</div>
</div></blockquote>
<p>通过单击 <em>操作</em> 菜单, 选择 <em>发送事件</em>, 在随后的对话框中点击 <em>上传</em> 按钮,
我们可以将事件发送到数据流中. 在电脑上浏览到 CDAP 主目录,
然后找到文件 <code class="docutils literal notranslate"><span class="pre">examples/resources/accesslog.txt</span></code> (包含在你的 CDAP Sandbox 中).
此文件包含 10,000 条CLF格式的记录.</p>
<p>成功上传文件后, 成功上传文件后数据流的 <em>总事件</em> 变为 10,000.</p>
<p>通过单击浏览器的返回按钮, 回到 <em>CDAP 数据流管道</em> 中.</p>
</li>
<li><p class="first">现在, 您可以运行这个数据流管道. 单击左上方的 <em>运行</em> 按钮.
(不需要运行时参数; 您可以单击出现的对话框中的 <em>立即开始</em>.)</p>
<p>数据流管道应开始运行, 如绿色的 <em>正在运行</em> 文本所示状态:</p>
<div class="figure align-center" id="id17" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-9-pipeline-running.png"><img alt="../_images/cdap-pipelines-gs-1-9-pipeline-running.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-9-pipeline-running.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 一个 <em>正在运行</em> 的数据流管道</span></p>
</div>
</li>
<li><p class="first">立刻, 处理的记录数将从零变为 10,000. 运行完成后，状态图标将变为 <em>已完成</em>.
开始时间和持续时间都显示在状态面板中:</p>
<div class="figure align-center" id="id18" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-10-completed.png"><img alt="../_images/cdap-pipelines-gs-1-10-completed.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-10-completed.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> <em>demoPipeline</em> 完成运行</span></p>
</div>
</li>
<li><p class="first">现在，您可以通过查看 <em>demoTable</em> 的内容来检查结果. 我们将使用一种更快的方法来查找数据集,
而不是使用 <em>在 CDAP 中查看</em> 按钮. 单击代表表格的图标, 以调出表格配置. 对话框的右上角是一个
<em>跳转</em> 按钮, 该按钮会弹出一个包含两个项目的菜单. 第一个直接将您带到 CDAP 表格.
(第二个将您带到 <span class="xref std std-ref">CDAP 元数据 UI</span> 表.)</p>
<div class="figure align-center" id="id19" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-11-jump-button.png"><img alt="../_images/cdap-pipelines-gs-1-11-jump-button.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-11-jump-button.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 管道配置对话框中的 <em>跳转</em> 按钮</span></p>
</div>
<p>导航到 <em>demoTable</em> 数据集, 并运行默认的 <em>探索</em> 查询, 该查询通过以下方式选择前五个记录:</p>
<ul class="simple">
<li>单击 <em>探索</em> 然后</li>
<li>单击 <em>执行 SQL</em>:</li>
</ul>
<div class="figure align-center" id="id20" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../_images/cdap-pipelines-gs-1-12-demotable.png"><img alt="../_images/cdap-pipelines-gs-1-12-demotable.png" class="bordered-image" src="../_images/cdap-pipelines-gs-1-12-demotable.png" style="width: 6in;" /></a>
<p class="caption"><span class="caption-text"><strong>CDAP 数据流管道:</strong> 探索 <em>demoTable</em> 的结果</span></p>
</div>
<p>在这里, 您可以看到日志记录已成功加载到数据流中, 由日志解析器解析, 然后作为解析记录保存到表中.
该数据现在可用于进一步分析, 例如查找唯一记录, 排序等.</p>
</li>
</ol>
<p>这样就完成了 CDAP 数据流管道 <em>入门指南</em>.</p>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="CDAP 数据流管道简介" href="concepts-design.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="CDAP 数据流设计器" href="studio.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../_static/js/js.cookie.js"></script><script type="text/javascript" src="../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>